﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLibrary.BLL;

namespace WebApplication2.Enseignant
{
    public partial class Fiche_Voeux : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = 1; //id enseignant
            BusinessLibrary.BLL.Enseignant _Enseignant = new BusinessLibrary.BLL.Enseignant();
            _Enseignant = BusinessLibrary.BLL.Enseignant.GetEnseignantById(id);

            //remlissage info perso
            lbNom.Text = _Enseignant.Nom;
            lbPrenom.Text = _Enseignant.Prenom;
            lbGrade.Text = _Enseignant.Grade.ToString();

            //remplilssage matiere et classe
            List<Niveau> _listeNiveau = BusinessLibrary.BLL.Niveau.GetListeListeNiveau();
            foreach (Niveau _niveau in _listeNiveau)
            {
                ddlniveau.Items.Add(new ListItem { Text = _niveau.Nom, Value = _niveau.Id.ToString() });

            }

        }

        protected void ddlSpecialite_load(object sender, EventArgs e)
        {
            int id_niv = int.Parse(ddlniveau.SelectedItem.Value);//id du niveau selectioner
            List<Specialite> _listeSpecialite = Specialite.GetListeListeSpecialite(id_niv);
            foreach (Specialite _specialite in _listeSpecialite)
            {
                ddlSpecialite.Items.Add(new ListItem { Text = _specialite.Nom, Value = _specialite.Id.ToString() });

            }
        }

        





    }
}
